#ifdef BUILD_DLL
# define EXPORT __declspec(dllexport)
#endif

#ifndef EXPORT
# define EXPORT
#endif

#ifndef HAVE_CELL
typedef long cell;
#endif

#define MODE_ANS 0 /* ANS terminal, xterm & co. */
#define MODE_CUR 1 /* curses based io */
#define MODE_WIN 2 /* Windows console based io */

#ifndef DEFAULT_MODE
#  define DEFAULT_MODE MODE_ANS
#endif

extern cell wrap_var_iomode;

EXPORT void wrap_at_xy(cell x, cell y);
EXPORT cell wrap_getx(void);
EXPORT cell wrap_gety(void);
EXPORT void wrap_emit(cell n);
EXPORT void wrap_type(cell p, cell n);
EXPORT void wrap_flush(void);
EXPORT void wrap_page(void);
EXPORT cell wrap_key(void);
EXPORT cell wrap_mouse_button(void);
EXPORT cell wrap_xkey(void);
EXPORT void wrap_iomode(cell m);
EXPORT void wrap_color(cell no);
EXPORT cell wrap_mousex(void);
EXPORT cell wrap_mousey(void);
EXPORT cell wrap_mousez(void);
EXPORT cell wrap_mouse_bstate(void);
EXPORT cell wrap_use_nc_mouse(void);
EXPORT cell wrap_mstate(void);

enum {  K_DN = 256,
        K_UP,
        K_LEFT,
        K_RIGHT,
        K_PGDN,
        K_PGUP,
        BACKSPACE,
        K_POS1,
        K_END,
        K_MOUSE,
        M_LKEY,
        M_RKEY,
        M_UP,
        M_DN };
